package IPrototipo.Funcionalidades.Menues;

import java.awt.Dimension;
import java.awt.Font;

import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.UIManager;

import java.awt.Component;
import javax.swing.Box;
import javax.swing.UIManager.LookAndFeelInfo;

import IPrototipo.ActionListeners.AutenticarAction;
import IPrototipo.ActionListeners.FuncionalidadNoImplementada;
import de.javasoft.plaf.synthetica.SyntheticaOrangeMetallicLookAndFeel;

public class MenuAutenticacion extends JPanel {



	private static final long serialVersionUID = 1L;
	private JTextField txtCorreoElectronico;
	private JPasswordField txtPassword;

	public MenuAutenticacion(FrameUsuarioNoAutenticado frame) {
		super();
		setOpaque(false);
		

		setFont(new Font("Andalus", Font.PLAIN, 14));

	    try 
	    {
	      UIManager.setLookAndFeel(new SyntheticaOrangeMetallicLookAndFeel());
	    } 
	    catch (Exception e) 
	    {
	      e.printStackTrace();
	    }

	/*
		try {
		    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
		        if ("Nimbus".equals(info.getName())) {
		            UIManager.setLookAndFeel(info.getClassName());
		            break;
		        }
		    }
		} catch (Exception e) {
		    //TODO NO SE PUDO PONER EL LOOK AND FEEL
			}
*/		
		setPreferredSize(new Dimension(800, 500));
		setAlignmentY(1.0f);
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		Dimension label= new Dimension(100, 30);
		Dimension datos= new Dimension(200, 30);
		Dimension panelLabel= new Dimension(600,80);
		
		JPanel panelCorreoElectronico = new JPanel();
		panelCorreoElectronico.setOpaque(false);
		add(panelCorreoElectronico);
		panelCorreoElectronico.setMaximumSize(panelLabel); 
		
		JLabel lblCorreoElectronico = new JLabel("Correo Electronico: ");
		lblCorreoElectronico.setHorizontalAlignment(SwingConstants.RIGHT);
		panelCorreoElectronico.add(lblCorreoElectronico);
		lblCorreoElectronico.setPreferredSize(label);
		
		Component horizontalStrut = Box.createHorizontalStrut(20);
		panelCorreoElectronico.add(horizontalStrut);
		
		txtCorreoElectronico = new JTextField();
		panelCorreoElectronico.add(txtCorreoElectronico);
		txtCorreoElectronico.setPreferredSize(datos);
		

		JPanel panelContrasenia = new JPanel();
		add(panelContrasenia);
		panelContrasenia.setOpaque(false);
		panelContrasenia.setMaximumSize(panelLabel);

		
		JLabel lblPassword = new JLabel("Password: ");
		lblPassword.setHorizontalAlignment(SwingConstants.RIGHT);
		panelContrasenia.add(lblPassword);
		lblPassword.setPreferredSize(label);
		
		Component horizontalStrut_1 = Box.createHorizontalStrut(20);
		panelContrasenia.add(horizontalStrut_1);
		
		txtPassword = new JPasswordField();
		panelContrasenia.add(txtPassword);
		txtPassword.setPreferredSize(datos);
		
		JPanel panelAutenticar = new JPanel();
		panelAutenticar.setOpaque(false);
		add(panelAutenticar);
		panelAutenticar.setMaximumSize(panelLabel);
		
		JButton btnAutenticar = new JButton("Autenticarse");
		panelAutenticar.add(btnAutenticar);
		btnAutenticar.setPreferredSize(datos);
		btnAutenticar.addActionListener(new AutenticarAction(frame, "", ""));
		
		Component verticalStrut = Box.createVerticalStrut(20);
		add(verticalStrut);
		
		JPanel panelRegistrarse = new JPanel();
		panelRegistrarse.setOpaque(false);
		add(panelRegistrarse);
		panelRegistrarse.setMaximumSize(panelLabel);
		
		JLabel lblRegistrarseAqui = new JLabel("Registrarse aqu\u00ED");
		panelRegistrarse.add(lblRegistrarseAqui);
		lblRegistrarseAqui.setHorizontalAlignment(SwingConstants.CENTER);
		lblRegistrarseAqui.setPreferredSize(datos);
		
		JPanel panelVerCompetencias = new JPanel();
		panelVerCompetencias.setOpaque(false);
		add(panelVerCompetencias);
		panelVerCompetencias.setMaximumSize(panelLabel);
		
		JButton btnVerCompetenciasDeportivas = new JButton("Ver Competencias Deportivas");
		panelVerCompetencias.add(btnVerCompetenciasDeportivas);
		btnVerCompetenciasDeportivas.setPreferredSize(datos);
		btnVerCompetenciasDeportivas.addActionListener(new FuncionalidadNoImplementada());
		
		JPanel panelSalir = new JPanel();
		panelSalir.setOpaque(false);
		add(panelSalir);
		panelSalir.setMaximumSize(panelLabel);
		
		JButton btnSalir = new JButton("Salir");
		panelSalir.add(btnSalir);
		btnSalir.setPreferredSize(datos);
		
		Component glue = Box.createGlue();
		add(glue);
		

	}
	
	

}